﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commerce.Base.Ubl.DataType
{
    /// <summary>
    /// A number of monetary units specified in a currency where the unit of the currency is explicit or implied.
    /// </summary>
    public class Amount
    {
        private System.Decimal value = System.Decimal.Zero;
        private Identifier currencyId;

        /// <summary>
        /// The amount value.
        /// </summary>
        public System.Decimal Value
        {
            get { return this.value; }
            set { this.value = value; }
        }

        /// <summary>
        /// The currency of the amount.
        /// </summary>
        public Identifier CurrencyId
        {
            get { return currencyId; }
            set { currencyId = value; }
        }

        public Amount(System.Decimal value, Identifier currencyId)
        {
            this.value = value;
            this.currencyId = currencyId;
        }

        public override string ToString()
        {
            return string.Format("{0} {1}", this.currencyId, value);
        }
    }


}
